package com.gsh.dao;

import com.gsh.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserMapper {
    List<User> queryUserList();

    //判断是否可以登录
    @Select("select count(*) from tb_user where UserName=#{username} and PassWord=#{password}")
    int queryBypw(String username,String password);

    @Insert("insert into tb_user(UserName,PassWord) values(#{username},#{password})")
    int addUser(User user);


}
